<?php
/*========================================= JooSam =========================================/
/																							/
/	Extention:		JooSam																	/
/	Created by:		ScriptPlanet.eu															/
/	Site:			http://www.scriptplanet.eu												/
/	Email:			support@scriptplanet.eu													/
/	Support:		http://www.scriptplanet.eu/support										/
/	Copyright:		2011 (c) ScriptPlanet.eu												/
/	License:		CC BY-NC-ND 3.0 ~ http://creativecommons.org/licenses/by-nc-nd/3.0/		/
/	File Version:	0001																	/
/																							/
/========================================== JooSam ========================================*/
// Joomla Security
defined('_JEXEC') or die;

jimport('joomla.application.component.view');
 
/**
 * HTML View class for the HelloWorld Component
 */
class JoosamViewRequest extends JView {

	// Overwriting JView display method
	function display($tpl = null){

		$data = new jsamRequest();

		$samtxt = $data->caller('samtxt');
		$request = $data->caller('request');
		$addmsg = $data->caller('addmsg');

		if (count($errors = $this->get('Errors'))){
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}

		$this->addmsg = $addmsg;
		$this->samtxt = $samtxt;
		$this->request = $request;

		$this->setDocument();
		// Display the view
		parent::display($tpl);
	}

	protected function setDocument(){

		$css = new jsamCssWork();
		$colorc = $css->rowbgcolor("colorc");
		$document = JFactory::getDocument();
		$document->addScript(JURI::root() . "administrator/components/com_joosam/javascript/jQuery/jquery.core.js");
		$document->addScript(JURI::root() . "administrator/components/com_joosam/javascript/jQuery/ui.core.js");
		$document->addScript(JURI::root() . "administrator/components/com_joosam/javascript/jQuery/ui.widget.js");
		$document->addScript(JURI::root() . "administrator/components/com_joosam/javascript/jQuery/ui.position.js");
		$document->addScript(JURI::root() . "administrator/components/com_joosam/javascript/jQuery/ui.autocomplete.js");
		$document->addStyleSheet( 'administrator/components/com_joosam/themes/jquery.ui.css' );
		$document->addStyleDeclaration( '
			.spBGTabel{
				background:'.$colorc.';
			}
			.ui-autocomplete-loading{
				background-color:none;
				background-image: url(../media/com_joosam/images/rotor.gif);
				background-position:right center;
				background-repeat:no-repeat;
			}
		');
	}

}